package string;

public class reverseStringTest {
    public void reverseString(char[] s){
        int i=0;
        int j=s.length-1;
        char temp;
        while(i<j){
            temp=s[i];
            s[i]=s[j];
            s[j]=temp;
            i++;
            j--;
        }
        for (int k=0;k<s.length;k++){
            System.out.println(s[k]);
        }
    }

    public static void main(String[] args) {
        char[] s={'h','e','l','l','o'};
        reverseStringTest reverseStringTest=new reverseStringTest();
        reverseStringTest.reverseString(s);
    }
}
